using GroupSix.Domain.Entity.App;

namespace GroupSix.Domain.Entity.App;

public class GsRole : EntityBase
{

    public string Name { get; private set; } = null!;

    public string? Description { get; private set; }  //角色描述

    public string Status { get; private set; } = "active";  //角色状态

    public ICollection<GsUserRole> GsUserRole { get; private set; } = new List<GsUserRole>();
    public ICollection<GsRoleMenu> GsRoleMenus { get; set; } = new List<GsRoleMenu>();

    private GsRole() { }

    public GsRole(string name, string? description = null, string status = "active")
    {
        Name = name;
        Description = description;
        Status = status;
    }

    /// <summary>
    /// 更新角色信息
    /// </summary>
    /// <param name="name">角色名称</param>
    /// <param name="description">角色描述</param>
    /// <param name="status">角色状态</param>
    public void UpdateInfo(string name, string? description, string status = "active")
    {
        Name = name;
        Description = description;
        Status = status;
        UpdatedAt = DateTime.UtcNow;
    }
}